<?php

class Site_My_Controller extends CI_Controller 
{
    function __construct() 
    {
        parent::__construct();
    }

    public function errorPage($data) 
    {
        $this->load->view('template/header', $data);
        $this->load->view('error/index', $data);
        $this->load->view('template/footer');
    }

    /*
      may be user is login
     */
    public function loadMenu($page, $data = array()) 
    {
        $datamenu = $this->getMenu();
        $this->load->view('template/header', $datamenu);
        $this->load->view('template/menu', $datamenu);
        $this->load->view('template/name', $datamenu);
        $this->load->view($page, $data);
        $this->load->view('template/footer');
    }

    /*
      may be user is login
     */
    public function getMenu() 
    {
        return $this->userauth->getMenu();
    }

    /*
      may user is not login
     */
    public function loadWithoutMenu($page, $data = array()) 
    {
        $this->load->view('template/header', $data);
        $this->load->view('template/name', $data);
        $this->load->view($page, $data);
        $this->load->view('template/footer');
    }

}

?>